package com.ruoyi.production.service.impl.plug;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.plug.PlugPurchase;
import com.ruoyi.production.domain.plug.PlugAmount;
import com.ruoyi.production.mapper.plug.PlugAmountMapper;
import com.ruoyi.production.service.plug.IPlugAmountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.plug.PlugAmountMapper;
import com.ruoyi.production.domain.plug.PlugAmount;
import com.ruoyi.production.service.plug.IPlugAmountService;

/**
 * 穴盘量Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class PlugAmountServiceImpl implements IPlugAmountService
{
    @Autowired
    private PlugAmountMapper plugAmountMapper;

    /**
     * 查询穴盘量
     *
     * @param plugAmountId 穴盘量ID
     * @return 穴盘量
     */
    @Override
    public PlugAmount selectPlugAmountById(Long plugAmountId)
    {
        return plugAmountMapper.selectPlugAmountById(plugAmountId);
    }

    /**
     * 查询穴盘量列表
     *
     * @param plugAmount 穴盘量
     * @return 穴盘量
     */
    @Override
    public List<PlugAmount> selectPlugAmountList(PlugAmount plugAmount)
    {
        return plugAmountMapper.selectPlugAmountList(plugAmount);
    }

    /**
     * 新增穴盘量
     *
     * @param plugAmount 穴盘量
     * @return 结果
     */
    @Override
    public int insertPlugAmount(PlugAmount plugAmount)
    {
        plugAmount.setCreateTime(DateUtils.getNowDate());
        return plugAmountMapper.insertPlugAmount(plugAmount);
    }

    /**
     * 修改穴盘量
     *
     * @param plugAmount 穴盘量
     * @return 结果
     */
    @Override
    public int updatePlugAmount(PlugAmount plugAmount)
    {
        plugAmount.setUpdateTime(DateUtils.getNowDate());
        return plugAmountMapper.updatePlugAmount(plugAmount);
    }

    /**
     * 批量删除穴盘量
     *
     * @param plugAmountIds 需要删除的穴盘量ID
     * @return 结果
     */
    @Override
    public int deletePlugAmountByIds(Long[] plugAmountIds)
    {
        return plugAmountMapper.deletePlugAmountByIds(plugAmountIds);
    }

    /**
     * 删除穴盘量信息
     *
     * @param plugAmountId 穴盘量ID
     * @return 结果
     */
    @Override
    public int deletePlugAmountById(Long plugAmountId)
    {
        return plugAmountMapper.deletePlugAmountById(plugAmountId);
    }

    @Override
    public int insertPurchaseUpdateAmount(PlugPurchase plugPurchase) {
        return 0;
    }
}
